package com.cacho.s2b.lesson.grammar.func;

import com.cacho.s2b.lesson.security.Activation;
import com.cacho.s2b.lesson.vo.ApiTestInfo;

public class GrammarFuncActivationKey implements GrammarFunc {
    public String getString(ApiTestInfo testInfo, String[] parts, int len) {
        int paramSize = parts.length;
        String type = "PrivateKey";
        if (paramSize < 1) {
            return null;
        }
        String groupId = parts[0];
        if (paramSize > 1) {
            type = parts[1];
        }
        String ActivationKey = Activation.loadActivationProps().getProperty(groupId + "_" + type);
        return ActivationKey;
    }
}
